<?php
namespace app\index\model;

use think\Model;
/*
 * insertMassage 插入工商信息
 * */

class Comassage extends Model
{
    /**
     * @param $companyMassage
     * @return void
     * ljj
     * 插入公司工商信息
     */
    public function insertMassage($companyMassage)
    {
        $this->save($companyMassage);
    }

    public function getCompanyMassageAttr($companyId)
    {
        return $this->alias('m')
            ->join('user u','u.company_id=m.company_id')
            ->where(
                ['u.company_id'=>$companyId,
                    'position' => '2'
                ]
            )
            ->find();
    }
}